﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_GetTeamRightList]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_GetTeamRightList];
GO
CREATE PROCEDURE [dbo].[sproc_GetTeamRightList]
    @Teamid int
/*

============================================================
功能:    得到@Teamid组权限包列表
参数:
    @Teamid int        :    组（类）ID
============================================================

*/

AS
BEGIN
SET NOCOUNT ON

SELECT
		a.rule_id,
		e.proc_name,
		e.proc_desc,
		d.classname teamname,
		d.classname,
		d.classid
    FROM
        UDS_Assign_Rule a
        left outer join uds_class d on d.classid = a.team_id
        inner join uds_proc e on e.proc_id = a.act_id
    WHERE
		a.based_on =2
        and a.team_id = @teamid
    ORDER BY a.rule_id

END
GO